// Light.h 
//////////////////////////////////////////////////////////////////////

#if !defined LIGHT_H
#define LIGHT_H

#include "SceneObject.h"
#include "Vec4.h"

class Light : public SceneObject
{
private:
    Vec4 ambient;
    Vec4 diffuse;
    Vec4 specular;
    Vec4 position;
    int number;
    static int nextNumber;
    //0-180 deg
    float spotCutOff;
    float conc;
    float atten;
    bool on;

public:
	Light();
	virtual ~Light();

	virtual RTTI_OBJECT_TYPE getType() const { return RTTI_LIGHT; }

	// Force every child to have a render and update methods
	virtual void render(float timeElapsed);
	virtual void update(float timeElapsed);
	virtual void setSpot();
	virtual void setDirect();
	virtual void setPos();
	int getNextNumber(){nextNumber++; return nextNumber-1;}
	virtual void setAmbient(Vec4 v) { ambient = v; }
	virtual void setDiffuse(Vec4 v) { diffuse = v; }
	virtual void setSpecular(Vec4 v) { specular = v; }
	virtual void setPosition(Vec4 v) { position = v; }
	virtual void setNumber(int n) { number = n; }
	virtual void setSpotCutOff(float cut){spotCutOff=cut;}
    virtual void setConc(float con){conc=con;}
    virtual void setAtten(float att){atten=att;}
    virtual void toggleOn(){
            on=!on;
            /*if(on==false){
                 parentObject->dropChild(this);
            }else{parentObject->addChild(this);}*/
    }
};
#endif // LIGHT_H
